<%@page import="orz.mikeneck.server.locrec.controller.LocRecAdminControllerImpl"%>
<%@page import="orz.mikeneck.server.locrec.persistent.LocRecUser"%>
<%@page import="java.util.List"%>
<%@page import="orz.mikeneck.server.locrec.controller.LocRecController"%>
<%@page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@page import="com.google.appengine.api.users.UserService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="utf-8"%>
<%
	UserService userService = UserServiceFactory.getUserService();
	LocRecController<List<LocRecUser>> controller = new LocRecAdminControllerImpl();
	List<LocRecUser> users = controller.execute(response);
%>
<!DOCTYPE html>
<html lang="ja">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Mike LocRec</title>
	<link href="/styles/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div id="header">
		<div id="logo">
			<h1><a href="#">MikeLocRec Manager Console</a></h1>
		</div>
		<div id="menu">
			<ul>
				<li><a href="<%= userService.createLogoutURL("/") %>">logout</a></li>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="page">
			<div id="content">
				<div class="post">
					<div class="entry">
						<table>
							<thead>
								<tr>
									<th>Login Id</th>
									<th>E-mail</th>
									<th>created at</th>
								</tr>
							</thead>
							<tbody>
							<% for(LocRecUser user : users){ %>
								<tr>
									<td style="width : 150px;"><%= user.getLoginId() %></td>
									<td style="width : 150px;"><%= user.getEmail() %></td>
									<td style="width : 300px;"><%= user.getCreatedAt() %></td>
								</tr>
							<% } %>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		<div id="sidebar"></div>
		<div style="clear : both;">&nbsp;</div>
	</div>
</body>
</html>
